package com.chat.common.exception;

import com.chat.common.result.R;

public class CommonException extends RuntimeException {

    private final R result;

    public CommonException(String message) {
        super(message);
        this.result = R.fail(message);
    }

    public CommonException(R result) {
        super(result.getMsg());
        this.result = result;
    }

    public R getResult() {
        return result;
    }
}
